<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2020/7/21
 * Time: 15:38
 */

namespace App\Services;


use app\common\model\AdminGroup;

class AdminGroupService
{
    /**create admin group
     * @param $param
     * @param $admin
     */
    public function createGroup($param,$admin){
        try{
            $groupData['group_name'] = $param['group_name'];
            $groupData['status'] = $param['status'];
           if(AdminGroup::create()->data($groupData)->save()){
               return ReponseCodeService::CODE_OK;
           }
            return ReponseCodeService::CODE_FAILE;
        }catch(\Throwable $t){
            return ReponseCodeService::CODE_DB_ERROR;
        }
    }
}